<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */ 
 
 
include (dirname(dirname(__FILE__)).'/sm/yt_prepar.php');
global $var_yttheme;
?>
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle() ?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
    var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
    var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->helper('core/js')->getTranslatorScript() ?>
<?php echo $this->getIncludes() ?>

<script type="text/javascript">
//<![CDATA[
	var SKIN_URL = '<?php echo $var_yttheme->skinurl();?>';
	var TMPL_NAME = '<?php echo $var_yttheme->template;?>';
	var TMPL_COOKIE = <?php echo json_encode($paramscookie); ?>;
//]]>
</script>

<link rel="stylesheet" href="<?php echo $this->getSkinUrl('css/yt-responsive.css'); ?>" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->getSkinUrl('css/colors/'.$var_yttheme->getParam('sitestyle').'.css') ?>" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->getSkinUrl('css/jquery.fancybox.css'); ?>" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->getSkinUrl('css/cloudzoom.css'); ?>" type="text/css" />

<link rel="stylesheet" href="<?php echo $this->getSkinUrl('css/new_cpanel.css'); ?>" type="text/css" />
<?php  if( $var_yttheme->getParam('showCpanel') ) { ?>
	<link rel="stylesheet" href="<?php echo $this->getSkinUrl('css/minicolors/jquery.miniColors.css'); ?>" type="text/css" />
<?php  } ?>

<?php 
if( isset($_SERVER['HTTPS'] )  && $_SERVER['HTTPS'] != 'off' ) {
    $http = 'https';
} else {
    $http = 'http';
}
$googleWebFont = $var_yttheme->getParam('googleWebFont');
$googleWebFontTargets = $var_yttheme->getParam('googleWebFontTargets');
if ( $googleWebFont != "" && $googleWebFont != "" ) {
	$googleWebFontFamily = str_replace(" ","+",$googleWebFont);
	$googleWebFontFamily = strpos($googleWebFontFamily, ':')?substr($googleWebFontFamily, 0, strpos($googleWebFontFamily, ':')):$googleWebFontFamily;
}
?>
<?php //die($googleWebFontFamily);?>

<?php if($googleWebFontFamily != "Roboto+Condensed+Regular"): ?>
	<link rel="stylesheet" type="text/css" href="<?php echo $http;?>://fonts.googleapis.com/css?family=<?php echo $googleWebFontFamily; ?>" media="all" />
<?php else:?>
	<?php
		echo '
			<style>
				@font-face {
				  font-family: "Roboto Condensed Regular";
				  font-style: normal;
				  font-weight: 400;
				  src: local("Roboto Condensed Regular"), local("RobotoCondensed-Regular"), url(http://themes.googleusercontent.com/static/fonts/robotocondensed/v9/Zd2E9abXLFGSr9G3YK2MsFzqCfRpIA3W6ypxnPISCPA.woff) format("woff");
				}
			</style>
		';	
	?>
<?php endif;?>

<style type="text/css">
<?php
// Body Font size
echo 'body{	
		font-size:'.$var_yttheme->getParam('fontsize').';	
	}';	
if( trim($var_yttheme->getParam('font_name'))!='' )
	echo '
		body{
			font-family:'.$var_yttheme->getParam('font_name').';	
		}';
if( trim($googleWebFontTargets)!="" )
	echo $googleWebFontTargets.'{
			font-family:'.$googleWebFont.', serif
		}';
	echo '
		body.'.$var_yttheme->template.'{	
			color:'.$var_yttheme->getParam('textcolor').' ;
		}
		body.'.$var_yttheme->template.'{	
			background-color:'.$var_yttheme->getParam('bgcolor').' ;
		}
		a{	
			color:'.$var_yttheme->getParam('linkcolor').' ;	
		}';
?>
</style>

<?php if ( null == Mage::registry('jsmart.jquery') ){
	// if module allowed jquery.
	Mage::register('jsmart.jquery', 1); ?>
	<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery-1.7.2.min.js') ?>"></script>
	<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jsmart.noconflict.js') ?>"></script>
<?php } ?>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.session.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/popuplogin.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.uniform.min.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.jqtransform.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('bootstrap/js/bootstrap.min.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/cloud-zoom.1.0.2.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jcarousellite_1.0.1.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.easing.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/yt-script.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.cookie.min.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.accordion_snyderplace.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/yt-extend.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/respond.src.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.fancybox.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/fancybox-buttons.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/sm-slider.js') ?>"></script>

<?php  if( $var_yttheme->getParam('showCpanel') ) { ?>
	<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/ytcpanel.js') ?>"></script>
	<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/minicolors/jquery.miniColors.min.js') ?>"></script>
<?php  } ?>

<?php
$keepontop_menu = $var_yttheme->getParam('keepontop_menu');
	if($keepontop_menu){?>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/yt-menuscript.js') ?>"></script>
<?php	}?>

<?php //die($var_yttheme->getParam('layout_styles'));
	$store=Mage::app()->getStore();
	$layoutStyle=Mage::getStoreConfig('salamy_cfg/general/layout_styles',$store);
	//die($layoutStyle);
?>

<script type="text/javascript">
//<![CDATA[
	$jsmart(document).ready(function($){  
		/* show-hidden login form */
		$(".header-login .login-quick").hide();
		$('.header-login a.login').click(function(){
			$this = $(this);
			$this.toggleClass("actived");
			$(".login-quick").slideToggle("fast");
		});
		/*show-hidden account user*/
		$(".header-user .links").hide();
		$('.header-user span.icon-user').click(function(){
			$this = $(this);
			$this.toggleClass("actived");
			$(".header-user .links").slideToggle("fast");
		});
	});
//]]>	
</script>

<script type="text/javascript">
//<![CDATA[
	$jsmart(function($){ 
	//style for select option, radio...
	$("#chk_remember").uniform();
	/* $(".check-shopby").uniform(); */
	$("#dont-show-again").uniform();
	$("#poll-answers .radio").uniform();
	$("#product-options-wrapper select").uniform();
	$("#toolbar-limit select").uniform();
	$(".toolbar .select-inner select").uniform();
	$(".sm-searbox-content .cat-wrapper select").uniform();
	});
//]]>
</script>

<script type="text/javascript">
//<![CDATA[
	$jsmart(function($) {
		//change select,option -> ul,li	
		$("select").jqTransform();
		$(".block-currency").jqTransform();
		$(".language-switcher").jqTransform();	
		/* $(".sm-searbox-content .cat-wrapper").jqTransform();	 */
		$(".language-switcher .jqTransformSelectWrapper").each(function(){
			arr_bg = new Array();
			arr_tit = new Array(); i=0;
			$(this).find('select option').each(function(){
				arr_bg[i] = $(this).css('background-image'); 
				arr_tit[i] = $(this).attr('title');
				i++;
			})
			j=0;
			$(this).find('ul li').each(function(){
				if(arr_bg[j]!="none"){
					$(this).find('a').css('background-image', arr_bg[j]);
				}
				$(this).find('a').attr('title', arr_tit[j]);
				j++;
			});
		});
		$('.language-switcher .jqTransformSelectWrapper ul li a.selected,.language-switcher .jqTransformSelectWrapper div span').css('background-image', $('#select-language option[selected="selected"]').css('background-image'));
		$('.language-switcher .jqTransformSelectWrapper div span').attr('title', $('#select-language option[selected="selected"]').attr('title'));
	});
//]]>	
</script>

<script type="text/javascript">
//<![CDATA[
    $jsmart(document).ready(function ($) {
		var tabActived;
		var tabNoticeActived = '<?php echo $var_yttheme->getParam('shownotice');?>';	
		if( tabNoticeActived == 'true' ){
			$jsmart('body').toggleClass("tab-notice-actived");
			$jsmart('.block-wrapper.notice-type').show();
		} else {	
			$jsmart('.block-wrapper.notice-type').show();
			$jsmart('.block-wrapper.notice-type')
				.toggleClass("actived");
			$jsmart('.block-wrapper.notice-type').find('.btn-custom')
				.toggleClass("btn-actived");				
		}			
		$jsmart('.block-wrapper').find('.btn-custom').click(function (e){
			/* hidden all tab openning before */
			if( tabActived!==this && tabActived && !$jsmart(this).closest('.block-wrapper').hasClass('notice-type') ){
				$jsmart(tabActived).closest('.block-wrapper').toggleClass("actived");	
				$jsmart(tabActived).toggleClass("btn-actived");
			}	
			/* open or hidden 1 tab clicked */
			$jsmart(this).closest('.block-wrapper').toggleClass("actived");
			$jsmart(this).toggleClass("btn-actived");	
			/* if tab click now is not notice-type then assign it to variable tabActived */
			tabActived = !$jsmart(this).closest('.block-wrapper').hasClass('notice-type') && $jsmart(this).hasClass('btn-actived') && this;	
			if( $jsmart(this).closest('.block-wrapper').hasClass('notice-type') ){
				$jsmart('body').toggleClass("tab-notice-actived");
				if( !$jsmart(this).hasClass('btn-actived') ){
					createCookie(TMPL_NAME+'_'+'shownotice', true, 365);
				} else {
					createCookie(TMPL_NAME+'_'+'shownotice', false, 365);
				}
			}
		});
    });
//]]>	
</script>
<script type="text/javascript">
//<![CDATA[
	$jsmart(document).ready(function ($) {
		//opacity content when hover menu megamenu	
		/* $jsmart('.sm_megamenu_wrapper_horizontal_menu .sm_megamenu_menu li.sm_megamenu_drop.sm_megamenu_lv1').hover(function(){
			$jsmart('#yt_header').css({'z-index':'9990', 'position': 'relative'});
			$jsmart('#blurmask').css({'display':'block', 'z-index': '999'});
		},function(){
			$jsmart('#blurmask').css({'display':'none', 'z-index': '9991','margin-top': '0'});
			$jsmart('#yt_header').css({'z-index':'990', 'position': 'relative'});			
		});
		
		$jsmart('.yt-menu-nav li.level0.parent').hover(function(){
			$jsmart('#yt_header').css({'z-index':'9990', 'position': 'relative'});
			$jsmart('#blurmask').css({'display':'block', 'z-index': '999'});
		},function(){
			$jsmart('#blurmask').css({'display':'none', 'z-index': '9991','margin-top': '0'});
			$jsmart('#yt_header').css({'z-index':'990', 'position': 'relative'});			
		});	 */	
		
	});
//]]>	
</script>
<?php //die($var_yttheme->getParam('layout_styles'));
	//$store=Mage::app()->getStore();
	//$layoutStyle=Mage::getStoreConfig('salamy_cfg/general/layout_styles',$store);
	//die($layoutStyle);
?>

<script>
	jQuery(document).ready(function ($) {
		$('.special-price').parent('.price-box').parent('.item-price').addClass('special-box');
		//$('.price-wrapper-shopby').parent().prev().addClass('hidden-title');
	});
</script>